{% extends "base.html" %}
{%block content%}

<div class="content-wrap ">
    <div class="bg-white round margin-top-30">
        <form class="pure-form pure-form-aligned clearfix form"  method="post" action="/sources/edit">
            <input type="hidden" name="table" value="sources">
            <input type="hidden" name="key" value="<(:key data)>">
            <fieldset class="left">
                <div class="title"><(if (:key data) "修改" "添加" )>线索</div>
                <div class="pure-control-group">
                    <label for="name"><span class="red">*</span>学员姓名</label>
                    <input id="name" name="name" type="text" value='<(if (data "name") (data "name") "")>' placeholder="">
                </div>

                <div class="pure-control-group">
                    <label for="parent">家长姓名</label>
                    <input id="parent" type="text" placeholder="" value='<(data "parent")>' name="parent">
                </div>

                <div class='pure-control-group <(if-not (get-in user [:is_admin]) "none")>'>
                    <label for="sales">招生老师</label>
                    <(if  (get-in user [:is_admin])  ">
                    <select id="sales" name="sales">
                        <option value="无">无</option>


                        <(for [p (:sales data)] ">
                        <option value="<(get-in p [:name])>"
                        <(if (and (:key data) (= (:name p) (data "sales"))) "selected=true")>><(get-in p [:name])></option>
                        <")>

                    </select>
                    <"">
                    <input type="hidden" name ="sales" value='<(:name user)>'>
                    <")>
                </div>
                <div class="pure-control-group">
                    <label for="name">线索来源</label>
                    <input class="" name="source-come" type="text" value='<(data "source-come")>'>
                </div>

                <div class="pure-control-group">
                    <label for="name">意向状态</label>
                    <select id="status" name="status">

                        <option value="无"
                        <(if (and (:key data) (= "无" (data "status"))) "selected=true")>>
                        无
                        </option>
                        <option value="成功"
                        <(if (and (:key data) (= "成功" (data "status"))) "selected=true")>>
                        成功
                        </option>
                        <option value="失败"
                        <(if (and (:key data) (= "失败" (data "status"))) "selected=true")>>
                        失败
                        </option>
                        <option value="继续跟进"
                        <(if (and (:key data) (= "继续跟进" (data "status"))) "selected=true")>>
                        继续跟进
                        </option>
                        <option value="潜在"
                        <(if (and (:key data) (= "潜在" (data "status"))) "selected=true")>>
                        潜在
                        </option>
                        <option value="意向中"
                        <(if (and (:key data) (= "意向中" (data "status"))) "selected=true")>>
                        意向中
                        </option>
                        <option value="意向中 强"
                        <(if (and (:key data) (= "意向中 强" (data "status"))) "selected=true")>>
                        意向中 强
                        </option>
                        <option value="意向中 中强"
                        <(if (and (:key data) (= "意向中 中强" (data "status"))) "selected=true")>>
                        意向中 中强
                        </option>
                        <option value="意向中 一般"
                        <(if (and (:key data) (= "意向中 一般" (data "status"))) "selected=true")>>
                        意向中 一般
                        </option>
                        <option value="预报名"
                        <(if (and (:key data) (= "预报名" (data "status"))) "selected=true")>>
                        预报名
                        </option>
                        <option value="已结束"
                        <(if (and (:key data) (= "已结束" (data "status"))) "selected=true")>>
                        已结束
                        </option>

                    </select>

                </div>

            </fieldset>
            <fieldset class="left">
                <div class="title">&nbsp;</div>
                <div class="pure-control-group">
                    <label for="phone">电话</label>
                    <input  name="phone" id="phone" value='<(data "phone")>' type="text">
                </div>
                <div class="pure-control-group">
                    <label for="qq">QQ</label>
                    <input class="" name="qq" id="qq" value='<(data "qq")>' type="text">
                </div>

                <div class="pure-control-group">
                    <label for="weixin">微信</label>
                    <input class="" name="weixin" id="weixin" value='<(data "weixin")>' type="text">
                </div>
                <div class="pure-control-group">
                    <label for="province">省／自治区</label>
                    <select id="province" name="province">
                        <option value="无"    <(if (and (:key data) (= "无" (data "province"))) "selected=true")>>无</option>
                        <option value="安徽"  <(if (and (:key data) (= "安徽" (data "province"))) "selected=true")>>安徽</option>
                        <option value="北京"  <(if (and (:key data) (= "北京" (data "province"))) "selected=true")>>北京</option>
                        <option value="福建"  <(if (and (:key data) (= "福建" (data "province"))) "selected=true")>>福建</option>
                        <option value="甘肃"  <(if (and (:key data) (= "甘肃" (data "province"))) "selected=true")>>甘肃</option>
                        <option value="广东"  <(if (and (:key data) (= "广东" (data "province"))) "selected=true")>>广东</option>
                        <option value="广西"  <(if (and (:key data) (= "广西" (data "province"))) "selected=true")>>广西</option>
                        <option value="贵州"  <(if (and (:key data) (= "贵州" (data "province"))) "selected=true")>>贵州</option>
                        <option value="海南"  <(if (and (:key data) (= "海南" (data "province"))) "selected=true")>>海南</option>
                        <option value="河北"  <(if (and (:key data) (= "河北" (data "province"))) "selected=true")>>河北</option>
                        <option value="河南"  <(if (and (:key data) (= "河南" (data "province"))) "selected=true")>>河南</option>
                        <option value="黑龙江"  <(if (and (:key data) (= "黑龙江" (data "province"))) "selected=true")>>黑龙江</option>
                        <option value="湖北"  <(if (and (:key data) (= "湖北" (data "province"))) "selected=true")>>湖北</option>
                        <option value="湖南"  <(if (and (:key data) (= "湖南" (data "province"))) "selected=true")>>湖南</option>
                        <option value="吉林"  <(if (and (:key data) (= "吉林" (data "province"))) "selected=true")>>吉林</option>
                        <option value="江苏"  <(if (and (:key data) (= "江苏" (data "province"))) "selected=true")>>江苏</option>
                        <option value="江西"  <(if (and (:key data) (= "江西" (data "province"))) "selected=true")>>江西</option>
                        <option value="辽宁"  <(if (and (:key data) (= "辽宁" (data "province"))) "selected=true")>>辽宁</option>
                        <option value="内蒙古"  <(if (and (:key data) (= "内蒙古" (data "province"))) "selected=true")>>内蒙古</option>
                        <option value="宁夏"  <(if (and (:key data) (= "宁夏" (data "province"))) "selected=true")>>宁夏</option>
                        <option value="青海"  <(if (and (:key data) (= "青海" (data "province"))) "selected=true")>>青海</option>
                        <option value="山东"  <(if (and (:key data) (= "山东" (data "province"))) "selected=true")>>山东</option>
                        <option value="山西"  <(if (and (:key data) (= "山西" (data "province"))) "selected=true")>>山西</option>
                        <option value="陕西"  <(if (and (:key data) (= "陕西" (data "province"))) "selected=true")>>陕西</option>
                        <option value="上海"  <(if (and (:key data) (= "上海" (data "province"))) "selected=true")>>上海</option>
                        <option value="四川"  <(if (and (:key data) (= "四川" (data "province"))) "selected=true")>>四川</option>
                        <option value="天津"  <(if (and (:key data) (= "天津" (data "province"))) "selected=true")>>天津</option>
                        <option value="西藏"  <(if (and (:key data) (= "西藏" (data "province"))) "selected=true")>>西藏</option>
                        <option value="新疆"  <(if (and (:key data) (= "新疆" (data "province"))) "selected=true")>>新疆</option>
                        <option value="云南"  <(if (and (:key data) (= "云南" (data "province"))) "selected=true")>>云南</option>
                        <option value="浙江"  <(if (and (:key data) (= "浙江" (data "province"))) "selected=true")>>浙江</option>
                        <option value="重庆"  <(if (and (:key data) (= "重庆" (data "province"))) "selected=true")>>重庆</option>
                    </select>
                </div>

                <div class="pure-control-group">
                    <label for="city">城市</label>
                    <input class="" name="city" id="city" value='<(data "city")>' type="text">
                </div>
            </fieldset>
            <div class="pure-controls left clear clear-both">

                <a href="javascript:void(0)" class="submit">
                    <img src="/img/confirm.png">

                </a>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="/sources">
                    <img src="/img/cancel.png">
                </a>
            </div>

        </form>
    </div>
</div>



{%endblock%}
{%block script%}
<script src="/js/source.bundle.js"></script>
{%endblock%}
